<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{/common/header::header-head}">
<body>
<div th:replace="~{/common/header::header-body}"></div>

<div class="container mt-3 text-justify-center">
    <h1 class="text-primary" th:text="${article.getTitle()}">标题</h1>
    <p th:text="${article.getContent()}">内容</p>
    <pre class="text-info" th:text="|本文创建于${#dates.format(article.getDate())}   分类:${article.getCategory()}|">信息</pre>
    <h2>评论</h2>
    <ul class="list-group">
        <li class="list-group-item" th:each="comment:${comments}">
            <p class="text-success" th:text="${comment.getContent()}">内容</p>
            <pre th:text="|评论时间${#dates.format(comment.getDate())}   作者:${comment.getAuthor()}|">信息</pre>
        </li>
    </ul>

    <form th:action="'/article/'+${article.getId()}+'/comment'" method="post">
        <div class="mb-3 mt-3">
            <label for="comment">请输入评论：</label>
            <textarea class="form-control" rows="5" id="comment" name="content" required></textarea>
        </div>
        <div class="mb-3">
            <label for="author" class="form-label">作者：</label>
            <input type="text" class="form-control" id="author" name="author" required>
        </div>
        <button type="submit" class="btn btn-primary">提交</button>
    </form>
</div>

</body>
</html>